<template>
  <el-select v-model="selectedOption" filterable placeholder="请选择" @change="handleChange">
    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
    </el-option>
  </el-select>
</template>

<script>
export default {
  data () {
    return {
      selectedOption: ''
    }
  },
  props: {
    options: {
      type: Array,
      require: true
    }
  },
  methods: {
    handleChange () {
      this.$emit('getOption', this.selectedOption)
    }
  },
  mounted () {
    this.selectedOption = this.options[0].value
    console.log(this.selectedOption)
  }
}
</script>

<style>
</style>